package com.lex.common.api;

import lombok.Data;

@Data
public class ResultCode implements IErrorCode{
    /**
     * 定义枚举常量SUCCESS(200, "操作成功")
     */
    public static final ResultCode SUCCESS = new ResultCode(200, "操作成功！");
    public static final ResultCode FAILED = new ResultCode(500, "操作失败！");
    public static final ResultCode SERVER_ERROR = new ResultCode(500, "服务器内部错误");
    public static final ResultCode VALIDATE_FAILED = new ResultCode(404, "参数检验失败");
    public static final ResultCode UNAUTHORIZED = new ResultCode(401, "token已经过期，请重新登录");
    public static final ResultCode FORBIDDEN = new ResultCode(403, "没有相关权限");
    private long code;
    private String message;
    public ResultCode(long code, String message){
        this.code = code;
        this.message = message;
    }
}
